package com.eeprint.web.controller.terminal;

import com.eeprint.common.utils.AjaxResult;
import com.eeprint.system.service.terminal.impl.TerminalServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 终端模块
 *
 * @author Samven7
 * @date 2020/10/18 10:49
 */
@RestController
public class TerminalController {
    @Autowired
    TerminalServiceImpl terminalService;

    /**
     * 终端登录
     * @param tenantTerminalCode 终端登陆码
     * @return AjaxResult
     */
    @PostMapping("/terminal/login")
    public AjaxResult terminalLogin(@RequestBody Map<String, String> map) {
        String tenantTerminalCode = map.get("tenantTerminalCode");
        if(terminalService.isExistTerminalCode(tenantTerminalCode)){
            return AjaxResult.success();
        }else {
            return AjaxResult.error();
        }
    }


}
